package com.iwat.enumeration;

/**
 * @Author wangweiqiang
 * @Classname EnumRequestMessageType
 * @Date 2022/3/27 15:24
 * @Description TODO
 */
public enum EnumRequestMessageType {
    // 请求消息类型
    TEXT("text", "文本"),
    IMAGE("image", "图片"),
    VOICE("voice", "语音"),
    VIDEO("video", "视频"),
    SHORTVIDEO("shortvideo", "小视频"),
    LOCATION("location", "地理位置"),
    LINK("link", "链接"),
    // 事件推送
    EVENT("event", "推送");

    private String type;
    private String content;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    EnumRequestMessageType(String type, String content) {
        this.type = type;
        this.content = content;
    }
    public static EnumRequestMessageType getEnum(String eventType) {
        if (eventType.equals(TEXT.type)){
            return TEXT;
        }else if(eventType.equals(IMAGE.type)){
            return IMAGE;
        }else if(eventType.equals(VOICE.type)){
            return VOICE;
        }else if(eventType.equals(VIDEO.type)){
            return VIDEO;
        }else if(eventType.equals(SHORTVIDEO.type)){
            return SHORTVIDEO;
        }else if(eventType.equals(LOCATION.type)){
            return LOCATION;
        }else if(eventType.equals(EVENT.type)){
            return EVENT;
        }else if(eventType.equals(EVENT.type)){
            return EVENT;
        }
        return null;
    }

    public String getTypeValue() {
        return content;
    }
}

